package com.eascs.cloudFile.service.impl;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.eascs.cloudFile.dao.CloudFilesDao;
import com.eascs.cloudFile.dao.FilesDao;
import com.eascs.cloudFile.entity.CloudDatalist;
import com.eascs.cloudFile.service.AdminFileService;
import com.eascs.cloudFile.vo.SaveFileVo;

/**
 * service库附件接口实现类
 * 
 * @author user
 *
 */
@Service
public class AdminFileServiceImpl implements AdminFileService {

	@Autowired
	FilesDao filesDao;

	@Autowired
	CloudFilesDao cloudFilesDao;
	
	/**
	 * 将云文档附件信息入库
	 * 
	 * @return
	 * @throws IOException 
	 */
	@Override
	public String saveFileToCloud(SaveFileVo saveFileVo) {
		CloudDatalist cloudDatalist = new CloudDatalist();
		cloudDatalist = cloudFilesDao.findCloudFileInfo(saveFileVo.getId());
		return filesDao.saveFile(cloudDatalist, saveFileVo);
	}

}
